// 导入我们封装的wxRequest方法
import wxRequest from '../utils/wxRequest'
//导入全局路径
import appConfig from '../utils/appConfig'
//设置请求API的根路径
wxRequest.baseURL = `${appConfig.HTTP_BAST_URL}/api/public/v1/`

//封装请求API，这里的用法类似axios
//我们的请求都写在这里面

//首页轮播图
const getHomeSwiper = params => {
  return wxRequest('home/swiperdata', params).then(res => res.data)
}
//首页导航
const getHomeNav = params => {
  return wxRequest('home/catitems', params).then(res => res.data)
}
// 首页楼层
const getHomeFloor = params => {
  return wxRequest('home/floordata', params).then(res => res.data)
}
//商品详情
const getGoodsDetail = params => {
  return wxRequest('goods/detail', params).then(res => res.data)
}


export default {
  getHomeSwiper,
  getHomeNav,
  getHomeFloor,
  getGoodsDetail
}
